home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
stv.lha
/
STV
/
st_v
/
util
/
STVUTIL7.ZIP
/
WIN31E.PRJ
< prev
next >
Wrap
Text File
|
1993-02-07
|
4KB
|
125 lines
"
******************************************************************************
Project : WIN31EXT.PRJ
Date : 'Jan 30, 1993'
Time : 18:10:43
Classes :
ShellDLL MMLib
Methods :
#wmDropFiles:with: defined in TopPaneJR.
******************************************************************************
"!
"Initialize"
WinEvents at: 563 put: #wmDropFiles:with:.
!
DynamicLinkLibrary variableByteSubclass: #MMLib
classVariableNames: ''
poolDictionaries: ''!
DynamicLinkLibrary variableByteSubclass: #ShellDLL
classVariableNames: ''
poolDictionaries: ''!
Smalltalk at: #TopPaneJR ifAbsent: [
TopPane subclass: #TopPaneJR
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: '']!
!ShellDLL class methods !
fileName
"---------------------------------------------------------------------------------------------------------------------------------------------------------
* Private *
- This is the API class for Shell
---------------------------------------------------------------------------------------------------------------------------------------------------------"
^'SHELL.DLL'! !
!ShellDLL methods !
dragAcceptFiles: aWindowHandle bool: aBool
<api: '#9' ushort ushort none>
^self invalidArgument!
dragQueryFile: wParam fileIndex: index fileBuffer: fb bufferSize: bufferSize
"---------------------------------------------------------------------------------------------------------------------------------------------------------
* Private *
-
---------------------------------------------------------------------------------------------------------------------------------------------------------"
<api: '#11' ushort short ulong ushort short>
^self invalidArgument! !
!MMLib class methods !
fileName
"---------------------------------------------------------------------------------------------------------------------------------------------------------
* Private *
- This is the API class for Mail
---------------------------------------------------------------------------------------------------------------------------------------------------------"
^'MMSYSTEM.DLL'! !
!MMLib methods !
sndPlaySound: aString flags: flagInteger
<api: SNDPLAYSOUND struct ushort boolean>
^self invalidArgument! !
!TopPaneJR methods !
wmDropFiles: wordInteger with: longInteger
"---------------------------------------------------------------------------------------------------------------------------------------------------------
* Private *
- Someone dropped a file on us.
- If its a word macro file then invoke word with the macro file
---------------------------------------------------------------------------------------------------------------------------------------------------------"
|shell files size addr |
shell := ShellDLL open.
files := shell dragQueryFile: wordInteger
fileIndex: 0 bitInvert asParameter
fileBuffer: 0
bufferSize: 0.
(files = 1)
ifTrue: [
files := files - 1.
size := (shell dragQueryFile: wordInteger
fileIndex: files asParameter
fileBuffer: 0
bufferSize: 0)+1.
addr := WinAddress allocateMemory: size.
shell dragQueryFile: wordInteger
fileIndex: files asParameter
fileBuffer: addr asParameter
bufferSize: size.
MessageBox message: 'Someone dropped ', (String fromAddress: addr), ' file on me!!'
]! !
"construct application"
((Smalltalk at: #Application ifAbsent: [])
isKindOf: Class) ifTrue: [
((Smalltalk at: #Application) for:'WIN31EXT.PRJ')
addClass: ShellDLL;
addClass: MMLib;
addMethod: #wmDropFiles:with: forClass: TopPaneJR;
comments: nil;
initCode: ' WinEvents at: 563 put: #wmDropFiles:with:.
';
finalizeCode: nil;
startUpCode: nil]!